home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 September / CHIP 1996 szeptember (CD07).zip / CHIP_CD07.ISO / povray30 / povmsdos.exe / POVMSDOS.ZIP / INCLUDE / SHAPES.INC < prev    next >
Text File  |  1996-02-11  |  4KB  |  156 lines

  1. #ifdef(Shapes_Inc_Temp)
  2. // do nothing
  3. #else
  4. #declare Shapes_Inc_Temp = version
  5. #version 3.0
  6.  
  7. #ifdef(View_POV_Include_Stack)
  8. #   debug "including shapes.inc\n"
  9. #end
  10.  
  11. /*
  12.               Persistence of Vision Raytracer Version 3.0
  13.  
  14.                                IMPORTANT!
  15.    This collection of standard shapes has been around since the days
  16.    of DKB-Trace and early versions of POV-Ray.  Those versions had no
  17. optomized primatives for planes, cones, disks etc.  Some of the definitions
  18.  below may seem trivial or unnecessary given the new POV-Ray 2.0 object
  19.    primatives.  We have retained these objects for compatibility with
  20.                            earlier versions.
  21.  
  22.  With the release of POV-Ray 1.0, some of these shapes, in particular,
  23. the "Disk_?" group, were changed from an earlier beta test and DKB-Trace
  24.    style.  The file "shapes.old" is also included in this package for
  25.                    compatibility with pre-1.0 scenes.
  26.  
  27. */
  28.  
  29.  
  30. #declare Ellipsoid =
  31.  sphere {<0, 0, 0>,1}
  32.  
  33. #declare Sphere =
  34.  sphere {<0, 0, 0>,1}
  35.  
  36. #declare Cylinder_X =
  37.  quadric
  38.   {<0, 1, 1>,
  39.    <0, 0, 0>,
  40.    <0, 0, 0>, -1
  41.   }
  42.  
  43. #declare Cylinder_Y =
  44.  quadric
  45.   {<1, 0, 1>,
  46.    <0, 0, 0>,
  47.    <0, 0, 0>, -1
  48.   }
  49.  
  50. #declare Cylinder_Z =
  51.  quadric
  52.   {<1, 1, 0>,
  53.    <0, 0, 0>,
  54.    <0, 0, 0>, -1
  55.   }
  56.  
  57. // Infinite cones
  58. #declare QCone_X =
  59.  quadric
  60.   {<-1, 1, 1>,
  61.    < 0, 0, 0>,
  62.    < 0, 0, 0>, 0
  63.   }
  64.  
  65. #declare QCone_Y =
  66.  quadric
  67.   {<1, -1, 1>,
  68.    <0, 0, 0>,
  69.    <0, 0, 0>, 0
  70.   }
  71.  
  72. #declare QCone_Z =
  73.  quadric
  74.   {<1, 1, -1>,
  75.    <0, 0, 0>,
  76.    <0, 0, 0>, 0
  77.   }
  78.  
  79. // Unit cones    
  80. // The Cone_n objects were formerly defined as intersections of
  81. // quadrics and boxes but now can be redefined with the cone primative.
  82.  
  83. #declare Cone_X = cone {x,0,-x,1}
  84. #declare Cone_Y = cone {y,0,-y,1}
  85. #declare Cone_Z = cone {z,0,-z,1}
  86.  
  87. // The Plane_nn objects were formerly defined as quadrics but now can
  88. // be redefined as a plane.
  89.  
  90. #declare Plane_YZ = plane {x,0}
  91. #declare Plane_XZ = plane {y,0}
  92. #declare Plane_XY = plane {z,0}
  93.  
  94. /* y^2 + z^2 - x = 0 */
  95. #declare Paraboloid_X =
  96.  quadric
  97.   {< 0, 1, 1>,
  98.    < 0, 0, 0>,
  99.    <-1, 0, 0>, 0
  100.   }
  101.  
  102. /* x^2 + z^2 - y = 0 */
  103. #declare Paraboloid_Y =
  104.  quadric
  105.   {<1,  0,  1>,
  106.    <0,  0,  0>,
  107.    <0, -1,  0>, 0
  108.   }
  109.  
  110. /* x^2 + y^2 - z = 0 */
  111. #declare Paraboloid_Z =
  112.  quadric
  113.   {<1,  1,  0>,
  114.    <0,  0,  0>,
  115.    <0,  0, -1>, 0
  116.   }
  117.  
  118. /* y - x^2 + z^2 = 0 */
  119. #declare Hyperboloid =
  120.  quadric
  121.   {<-1,  0,  1>,
  122.    < 0,  0,  0>,
  123.    < 0,  1,  0>, 0
  124.   }
  125.  
  126. #declare Hyperboloid_Y =
  127.  quadric                 /* Vertical hyperboloid */
  128.   {<1, -1,  1>,          /*                      */
  129.    <0,  0,  0>,          /*            \   /     */
  130.    <0,  0,  0>, -1       /* Like this:  ) (      */
  131.   }                      /*            /   \     */
  132.  
  133. // Cube using the procedural box primitive
  134. #declare UnitBox = box { <-1, -1, -1>, <1, 1, 1> }
  135.  
  136. // This primitive used to be an intersection of six planes.  For speed,
  137. // it is now a box and nothing else.
  138. #declare Cube = box { <-1, -1, -1>, <1, 1, 1> }
  139.  
  140. // The Disk primitives are "capped" cylinders of unit length.
  141. //
  142. // They are now "unit" size, the same as a sphere with a radius of 1.
  143. // They will now scale evenly in all directions.
  144.  
  145. #declare Disk_X =    /* Capped cylinder, Length in x axis */
  146.  cylinder { x,-x,1}
  147.  
  148. #declare Disk_Y =    /* Capped cylinder, Length in y axis */
  149.  cylinder { y,-y,1}
  150.  
  151. #declare Disk_Z =    /* Capped cylinder, Length in z axis */
  152.  cylinder { z,-z,1}
  153.  
  154. #version Shapes_Inc_Temp
  155. #end
  156.